/**
 * Created by kevin on 2017/01/08.
 *
 * page base
 */


var eosi = window.eosi || {};
this.eosi.website = this.eosi.website || {};

(function (window) {
    // the application

    /*
     **eg 传入会添加传入图片大小的热区
     */
    function BaseButton(eg) {
        this.eg=eg || null;
        this.Container_constructor();
        this.init();
        //console.log(this.father.targetWidth);
    }

    var p = createjs.extend(BaseButton, createjs.Container);
    p.className = "BaseButton";
    p.oriScale;


    // public methods:
    p.init = function () {
        if (this.eg) {
            var button_mask = new createjs.Shape();
            button_mask.graphics.f(createjs.Graphics.getRGB(255, 255, 255, 0.01)).drawRect(0,0,this.eg.getBounds().width,this.eg.getBounds().height);
            this.addChild(this.eg);
            this.addChild(button_mask);
        }
        

        this.on("mousedown", this.onMouseDown, this);
        this.on("pressup", this.onMouseUp, this);
        this.oriScale = this.scaleX;
    }

    p.onMouseDown = function(evt){

        this.scaleX = this.scaleY = this.oriScale*.9;
    }
    p.onMouseUp = function(evt){
        //console.log("sss")
        this.scaleX = this.scaleY = this.oriScale;
    }

    // add MyApp to myNameSpace
    window.eosi.website.BaseButton = createjs.promote(BaseButton, "Container");
//}());
}(window));





